<template>
	<!-- d1d1d1 -->
	<view>
		<view style="width: 100%;">
			<view style="background-color: #ffffff;width: 700rpx;height: 240rpx;border-radius: 40rpx;margin-left: 24rpx;margin-top: 40rpx;">
				<view style="font-size: 36rpx;font-weight: bold;position: relative;top: 30rpx;left: 60rpx;">收益管理</view>
				<view style="display: flex;">
					<view class="moneyclick" @tap="tomonrydetail">
						<image src="../../static/page/shebei.png" style="width: 50rpx;height: 50rpx;"></image>
						<view>收益明细</view>
					</view>
					<view class="moneyclick" @tap="togetmoney">
						<image src="../../static/page/shebei.png" style="width: 50rpx;height: 50rpx;"></image>
						<view>收益提现</view>
					</view>
					<view class="moneyclick" @tap="todaymoney">
						<image src="../../static/page/shebei.png" style="width: 50rpx;height: 50rpx;"></image>
						<view>每日收益</view>
					</view>
				</view>
			</view>
			<view style="background-color: #ffffff;width: 700rpx;height: 240rpx;border-radius: 40rpx;margin-left: 24rpx;margin-top: 40rpx;" v-if="level > 0">
				<view style="font-size: 36rpx;font-weight: bold;position: relative;top: 30rpx;left: 60rpx;">账号管理</view>
				<view style="display: flex;">
					<view class="moneyclick" @tap="tousermanage">
						<image src="../../static/page/shebei.png" style="width: 50rpx;height: 50rpx;"></image>
						<view>用户管理</view>
					</view>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	let App = getApp();

	export default {
		data() {
			return {
				level:'',
			}
		},
		onLoad(){
			this.getUserinfo()
		},
		
		methods: {

			tomonrydetail(){
				uni.navigateTo({
					url:"/pages/work/moneydetail"
				})
			},
			todaymoney(){
				uni.navigateTo({
					url:"/pages/work/daymoney"
				})
			},
			togetmoney(){
				uni.navigateTo({
					url:"/pages/my/gorule"
				})
			},
			tousermanage(){
				uni.navigateTo({
					url:"/pages/work/usermanage"
				})
			},
			getUserinfo(){
				let userinfo = uni.getStorageSync('userinfo');
			
				uni.showLoading({
					title:"加载中"
				})
				
				this.$api.interfaceApi('getUserinfo')({
					'id': userinfo.id,
					'admin':App.globalData.sys
				}).then(res=>{
					uni.hideLoading()
					this.level = res.data.level
				})
			},
			
		}
	}
</script>

<style>
	.moneyclick{
		margin-left: 60rpx;
		margin-top: 60rpx;
		text-align: center;
	}
</style>